package com.youxue.dao;

import com.youxue.entity.Dynamic;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DynamicMapper {
    int deleteByPrimaryKey(Integer dynamicId);

    int insert(Dynamic record);

    int insertSelective(Dynamic record);

    Dynamic selectByPrimaryKey(Integer dynamicId);

    int updateByPrimaryKeySelective(Dynamic record);

    int updateByPrimaryKey(Dynamic record);

    int selectTotalRecord();

    List<Dynamic> showAllDynamicByPage(@Param(value = "startPro") Integer startPro, @Param(value = "pageSize") Integer pageSize);

    List<Dynamic> selectTest(@Param(value = "userId") Integer userId);

    List<Dynamic> showUnknownNews(@Param(value = "userId") Integer userId);

    List<Dynamic> showNews(@Param(value = "userId") Integer userId);

    Integer readNews(@Param(value = "replayId") Integer replayId, @Param(value = "interactionId") Integer interactionId);

    //查询一条动态详情
    Dynamic showOneDynamic(@Param(value = "dynamicId") Integer dynamicId);


    Dynamic showAllReview(@Param(value = "dynamicId") Integer dynamicId);


    void giveLike(@Param(value = "dynamicDynamicId") Integer dynamicDynamicId);

    int countLike(@Param(value = "dynamicId") Integer dynamicId);

    /**
     * 查询一个用户发布的所有动态列表
     * @param userId
     * @return
     */
    List<Dynamic> selectAUserListDynamics(@Param(value = "userId") Integer userId);

    /**
     * 删除一条动态
     * @param dynamicId
     * @return
     */
}